package framework.bean;

import java.sql.Date;

public class Reservation {

	
	private int reserv_id;
	private int cli_id;
	private int film_id;
	private Date reserv_date;
	private Date reserv_date_loc;
	private Date reserv_date_fin;
	
	public Reservation() {
		setReserv_id(0);
		setCli_id(0);
		setFilm_id(0);
		setReserv_date(null);
		setReserv_date_fin(null);
		setReserv_date_loc(null);
	}
	
	public Reservation(int reserv_id,
						 int cli_id,
						 int film_id,
						 Date reserv_date,
						 Date reserv_date_loc,
						 Date reserv_date_fin) {
		setReserv_id(reserv_id);
		setCli_id(cli_id);
		setFilm_id(film_id);
		setReserv_date(reserv_date);
		setReserv_date_fin(reserv_date_fin);
		setReserv_date_loc(reserv_date_loc);
	}
	public Reservation(
				 int cli_id,
				 int film_id,
				 Date reserv_date) {
		setCli_id(cli_id);
		setFilm_id(film_id);
		setReserv_date(reserv_date);
		
		}
	public Reservation(int cli_id,
			 int film_id,
			 Date reserv_date,
			 Date reserv_date_loc,
			 Date reserv_date_fin) {
	setReserv_id(0);
	setCli_id(cli_id);
	setFilm_id(film_id);
	setReserv_date(reserv_date);
	setReserv_date_fin(reserv_date_fin);
	setReserv_date_loc(reserv_date_loc);
	}

	/**
	 * @return the reserv_id
	 */
	public int getReserv_id() {
		return reserv_id;
	}

	/**
	 * @return the cli_id
	 */
	public int getCli_id() {
		return cli_id;
	}

	/**
	 * @return the film_id
	 */
	public int getFilm_id() {
		return film_id;
	}

	/**
	 * @return the reserv_date
	 */
	public Date getReserv_date() {
		return reserv_date;
	}

	/**
	 * @return the reserv_date_loc
	 */
	public Date getReserv_date_loc() {
		return reserv_date_loc;
	}

	/**
	 * @return the reserv_date_fin
	 */
	public Date getReserv_date_fin() {
		return reserv_date_fin;
	}

	/**
	 * @param reserv_id the reserv_id to set
	 */
	public void setReserv_id(int reserv_id) {
		this.reserv_id = reserv_id;
	}

	/**
	 * @param cli_id the cli_id to set
	 */
	public void setCli_id(int cli_id) {
		this.cli_id = cli_id;
	}

	/**
	 * @param film_id the film_id to set
	 */
	public void setFilm_id(int film_id) {
		this.film_id = film_id;
	}

	/**
	 * @param reserv_date the reserv_date to set
	 */
	public void setReserv_date(Date reserv_date) {
		this.reserv_date = reserv_date;
	}

	/**
	 * @param reserv_date_loc the reserv_date_loc to set
	 */
	public void setReserv_date_loc(Date reserv_date_loc) {
		this.reserv_date_loc = reserv_date_loc;
	}

	/**
	 * @param reserv_date_fin the reserv_date_fin to set
	 */
	public void setReserv_date_fin(Date reserv_date_fin) {
		this.reserv_date_fin = reserv_date_fin;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + cli_id;
		result = prime * result + film_id;
		result = prime * result
				+ ((reserv_date == null) ? 0 : reserv_date.hashCode());
		result = prime * result
				+ ((reserv_date_fin == null) ? 0 : reserv_date_fin.hashCode());
		result = prime * result
				+ ((reserv_date_loc == null) ? 0 : reserv_date_loc.hashCode());
		result = prime * result + reserv_id;
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof Reservation)) {
			return false;
		}
		Reservation other = (Reservation) obj;
		if (cli_id != other.cli_id) {
			return false;
		}
		if (film_id != other.film_id) {
			return false;
		}
		if (reserv_date == null) {
			if (other.reserv_date != null) {
				return false;
			}
		} else if (!reserv_date.equals(other.reserv_date)) {
			return false;
		}
		if (reserv_date_fin == null) {
			if (other.reserv_date_fin != null) {
				return false;
			}
		} else if (!reserv_date_fin.equals(other.reserv_date_fin)) {
			return false;
		}
		if (reserv_date_loc == null) {
			if (other.reserv_date_loc != null) {
				return false;
			}
		} else if (!reserv_date_loc.equals(other.reserv_date_loc)) {
			return false;
		}
		if (reserv_id != other.reserv_id) {
			return false;
		}
		return true;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Reservation [reserv_id=" + reserv_id + ", cli_id=" + cli_id
				+ ", film_id=" + film_id + ", reserv_date=" + reserv_date
				+ ", reserv_date_loc=" + reserv_date_loc + ", reserv_date_fin="
				+ reserv_date_fin + "]";
	}

}
